package com.iot.ammeter.ui.components.auth

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Icon
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Text
import androidx.compose.material.TextFieldDefaults
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Email
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.iot.ammeter.R
import com.iot.ammeter.ui.theme.material3OutlinedTextFieldColors

@Composable
fun EmailTextField(
    value: String,
    modifier: Modifier = Modifier,
    onValueChange: (String) -> Unit
) = OutlinedTextField(
    label = { Text(text = stringResource(id = R.string.email)) },
    leadingIcon = {
        Icon(
            imageVector = Icons.Filled.Email,
            contentDescription = stringResource(id = R.string.email)
        )
    },
    value = value,
    onValueChange = onValueChange,
    maxLines = 1,
    singleLine = true,
    modifier = modifier.fillMaxWidth(),
    colors = TextFieldDefaults.material3OutlinedTextFieldColors()
)